home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- /*
- glotopdat.c - glo_object ASCII file format to polydata binary file format
- converter.
-
- Tim Heidmann, Silicon Graphics
- June 26, 1991
- */
- #include <stdio.h>
- #include "glo_obj.h"
- #include "shadows.h"
-
- PolyDataPtr
- GetPolyData(glo_ObjPtr);
-
- main(int argc, char *argv[]) {
- glo_ObjPtr myGLObj;
- PolyDataPtr myPData;
- char *inFile, *outFile;
-
- /* Parse and check the arguments */
- if (argc == 3) {
- inFile = argv[1]; outFile = argv[2];
- } else {
- fprintf(stderr, "usage: %s <infile.glo> <outfile.pdat>\n", argv[0]);
- exit(1);
- }
-
- /* Read the .glo file */
- if ((myGLObj = glo_ReadObj(inFile)) == NULL) {
- fprintf(stderr, "Cannot read input file %s\n", inFile);
- exit(1);
- }
-
- /* Build the edge-adjacency poly data lists */
- myPData = GetPolyData(myGLObj);
-
- /* Write the combined structure to a file */
- if (!WritePDataObj(outFile, myGLObj, myPData)) {
- fprintf(stderr, "Cannot write output file %s\n", outFile);
- exit(1);
- }
- }
-